<template>
  <div class="app-container">

    <!-- 搜索工作栏 -->
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="患者登记表" prop="patientId">
        <el-input v-model="queryParams.patientId" placeholder="请输入患者登记表" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="患者hisId" prop="patientHisId">
        <el-input v-model="queryParams.patientHisId" placeholder="请输入患者hisId" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="门诊号" prop="outpatientServiceNumber">
        <el-input v-model="queryParams.outpatientServiceNumber" placeholder="请输入门诊号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="腹透号" prop="pdNumber">
        <el-input v-model="queryParams.pdNumber" placeholder="请输入腹透号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="姓名" prop="patientNm">
        <el-input v-model="queryParams.patientNm" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="拼音码" prop="patientPy">
        <el-input v-model="queryParams.patientPy" placeholder="请输入拼音码" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="性别 0女 1男 " prop="patientSex">
        <el-select v-model="queryParams.patientSex" placeholder="请选择性别 0女 1男 " clearable size="small">
          <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PATIENT_SEX)"
                       :key="dict.value" :label="dict.label" :value="dict.value"/>
        </el-select>
      </el-form-item>
      <el-form-item label="年龄" prop="patientAge">
        <el-input v-model="queryParams.patientAge" placeholder="请输入年龄" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="民族" prop="patientNation">
        <el-select v-model="queryParams.patientNation" placeholder="请选择民族" clearable size="small">
          <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PATIENT_NATION)"
                       :key="dict.value" :label="dict.label" :value="dict.value"/>
        </el-select>
      </el-form-item>
      <el-form-item label="婚姻状况0001未婚 0002 已婚 0003 丧偶 0004 离婚 0005 其他" prop="maritalStatus">
        <el-select v-model="queryParams.maritalStatus" placeholder="请选择婚姻状况0001未婚 0002 已婚 0003 丧偶 0004 离婚 0005 其他" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="身份证号" prop="patientCardId">
        <el-input v-model="queryParams.patientCardId" placeholder="请输入身份证号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="收费模式" prop="chargeMode">
        <el-input v-model="queryParams.chargeMode" placeholder="请输入收费模式" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="患者类型" prop="chargeType">
        <el-select v-model="queryParams.chargeType" placeholder="请选择患者类型" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="出生日期" prop="patientBirthday">
        <el-date-picker clearable v-model="queryParams.patientBirthday" type="date" value-format="yyyy-MM-dd" placeholder="选择出生日期" />
      </el-form-item>
      <el-form-item label="身高" prop="patientHeight">
        <el-input v-model="queryParams.patientHeight" placeholder="请输入身高" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="净体重" prop="dryWeight">
        <el-input v-model="queryParams.dryWeight" placeholder="请输入净体重" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="入院时间" prop="inHospitalDate">
        <el-date-picker v-model="queryParams.inHospitalDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="出院时间" prop="dischargeDate">
        <el-date-picker v-model="queryParams.dischargeDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="死亡时间" prop="deathDate">
        <el-date-picker v-model="queryParams.deathDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="联系电话" prop="patientTel">
        <el-input v-model="queryParams.patientTel" placeholder="请输入联系电话" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="联系电话2" prop="patientTel2">
        <el-input v-model="queryParams.patientTel2" placeholder="请输入联系电话2" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="邮政编码" prop="postCode">
        <el-input v-model="queryParams.postCode" placeholder="请输入邮政编码" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="住院号" prop="hospitalizationNumber">
        <el-input v-model="queryParams.hospitalizationNumber" placeholder="请输入住院号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="通讯地址" prop="patientAddress">
        <el-input v-model="queryParams.patientAddress" placeholder="请输入通讯地址" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="工作性质 onW退休  offW在职" prop="patientWorkType">
        <el-select v-model="queryParams.patientWorkType" placeholder="请选择工作性质 onW退休  offW在职" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="工作单位" prop="patientUnit">
        <el-input v-model="queryParams.patientUnit" placeholder="请输入工作单位" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="紧急联系人" prop="emergencyContact">
        <el-input v-model="queryParams.emergencyContact" placeholder="请输入紧急联系人" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="联系人关系" prop="patientRelation">
        <el-input v-model="queryParams.patientRelation" placeholder="请输入联系人关系" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="医保卡号" prop="yiBaoCard">
        <el-input v-model="queryParams.yiBaoCard" placeholder="请输入医保卡号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="删除标志位 0删除 1 未删除" prop="isActive">
        <el-input v-model="queryParams.isActive" placeholder="请输入删除标志位 0删除 1 未删除" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="创建人" prop="createBy">
        <el-input v-model="queryParams.createBy" placeholder="请输入创建人" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="创建时间" prop="createDt">
        <el-date-picker clearable v-model="queryParams.createDt" type="date" value-format="yyyy-MM-dd" placeholder="选择创建时间" />
      </el-form-item>
      <el-form-item label="更新人" prop="updateBy">
        <el-input v-model="queryParams.updateBy" placeholder="请输入更新人" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="更新时间" prop="updateDt">
        <el-input v-model="queryParams.updateDt" placeholder="请输入更新时间" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="患者类型1  1感染 / 0未感染" prop="patientTypeOne">
        <el-input v-model="queryParams.patientTypeOne" placeholder="请输入患者类型1  1感染 / 0未感染" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="患者类型2  1住院/2门诊" prop="patientTypeTwo">
        <el-input v-model="queryParams.patientTypeTwo" placeholder="请输入患者类型2  1住院/2门诊" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="诊断" prop="diagnose">
        <el-select v-model="queryParams.diagnose" placeholder="请选择诊断" clearable size="small">
          <el-option v-for="dict in this.getDictDatas(DICT_TYPE.DIAGNOSE_INFO)"
                       :key="dict.value" :label="dict.label" :value="dict.value"/>
        </el-select>
      </el-form-item>
      <el-form-item label="原发病类型" prop="protopathy">
        <el-select v-model="queryParams.protopathy" placeholder="请选择原发病类型" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="病理诊断" prop="pathologicDiagnose">
        <el-input v-model="queryParams.pathologicDiagnose" placeholder="请输入病理诊断" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="合并症" prop="complication">
        <el-input v-model="queryParams.complication" placeholder="请输入合并症" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="置管类型" prop="zhiguanType">
        <el-select v-model="queryParams.zhiguanType" placeholder="请选择置管类型" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="置管时间" prop="zhiguanDate">
        <el-date-picker v-model="queryParams.zhiguanDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="既往病史" prop="pastMedicalHistory">
        <el-input v-model="queryParams.pastMedicalHistory" placeholder="请输入既往病史" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="hd几年" prop="hdYears">
        <el-input v-model="queryParams.hdYears" placeholder="请输入hd几年" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="肾移植几年" prop="rtYears">
        <el-input v-model="queryParams.rtYears" placeholder="请输入肾移植几年" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="乙肝" prop="isHepatitisB">
        <el-input v-model="queryParams.isHepatitisB" placeholder="请输入乙肝" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="丙肝" prop="isHepatitisC">
        <el-input v-model="queryParams.isHepatitisC" placeholder="请输入丙肝" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="是否糖尿病" prop="isDm">
        <el-input v-model="queryParams.isDm" placeholder="请输入是否糖尿病" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="尿量" prop="urinaryVolume">
        <el-input v-model="queryParams.urinaryVolume" placeholder="请输入尿量" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="hiv" prop="isHiv">
        <el-input v-model="queryParams.isHiv" placeholder="请输入hiv" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="梅毒" prop="isSyphilis">
        <el-input v-model="queryParams.isSyphilis" placeholder="请输入梅毒" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="病人状态（1入档，2死亡，3结案）" prop="patientStatus">
        <el-select v-model="queryParams.patientStatus" placeholder="请选择病人状态（1入档，2死亡，3结案）" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="腹透开始时间" prop="firstTreatmentDate">
        <el-date-picker clearable v-model="queryParams.firstTreatmentDate" type="date" value-format="yyyy-MM-dd" placeholder="选择腹透开始时间" />
      </el-form-item>
      <el-form-item label="备注" prop="remarks">
        <el-input v-model="queryParams.remarks" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="离开腹透原因" prop="leavePdReason">
        <el-input v-model="queryParams.leavePdReason" placeholder="请输入离开腹透原因" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="离开腹透日期" prop="leavePdDate">
        <el-date-picker v-model="queryParams.leavePdDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="腹膜炎重点病人" prop="isPeritonitisPatient">
        <el-input v-model="queryParams.isPeritonitisPatient" placeholder="请输入腹膜炎重点病人" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="外口感染患者" prop="isExternalInfectionPatient">
        <el-input v-model="queryParams.isExternalInfectionPatient" placeholder="请输入外口感染患者" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="容量管控重点病人" prop="isCapcontrolPatient">
        <el-input v-model="queryParams.isCapcontrolPatient" placeholder="请输入容量管控重点病人" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="首次腹透时已透次数" prop="firstPdTimes">
        <el-input v-model="queryParams.firstPdTimes" placeholder="请输入首次腹透时已透次数" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="腹透次数" prop="pdTimes">
        <el-input v-model="queryParams.pdTimes" placeholder="请输入腹透次数" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="复查周期" prop="revisitCycle">
        <el-input v-model="queryParams.revisitCycle" placeholder="请输入复查周期" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="首次复诊日期" prop="revisitDate">
        <el-date-picker v-model="queryParams.revisitDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="复诊计划id" prop="revisitRecordsId">
        <el-input v-model="queryParams.revisitRecordsId" placeholder="请输入复诊计划id" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="随访周期" prop="followupCycle">
        <el-input v-model="queryParams.followupCycle" placeholder="请输入随访周期" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="下次随访日期" prop="nextFollowupDate">
        <el-date-picker v-model="queryParams.nextFollowupDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="标记患者" prop="patientFlag">
        <el-input v-model="queryParams.patientFlag" placeholder="请输入标记患者" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="死亡原因" prop="deathReason">
        <el-input v-model="queryParams.deathReason" placeholder="请输入死亡原因" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="初次诊断（上报平台的临床诊断）" prop="linchuangZhenduan">
        <el-input v-model="queryParams.linchuangZhenduan" placeholder="请输入初次诊断（上报平台的临床诊断）" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="转为血透原因" prop="hemodialysisReason">
        <el-input v-model="queryParams.hemodialysisReason" placeholder="请输入转为血透原因" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="教育程度" prop="educationLevel">
        <el-input v-model="queryParams.educationLevel" placeholder="请输入教育程度" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="职业" prop="occupation">
        <el-input v-model="queryParams.occupation" placeholder="请输入职业" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="原发病诊断日期" prop="protopathyDate">
        <el-date-picker v-model="queryParams.protopathyDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="临床诊断日期" prop="clinicalDiagnosisDate">
        <el-date-picker v-model="queryParams.clinicalDiagnosisDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="是否导出过退出记录：0为未导出，1为已导出" prop="isInOutExportStatus">
        <el-select v-model="queryParams.isInOutExportStatus" placeholder="请选择是否导出过退出记录：0为未导出，1为已导出" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="门诊为1，住院为2" prop="patientProperty">
        <el-input v-model="queryParams.patientProperty" placeholder="请输入门诊为1，住院为2" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="app注册码" prop="registrationCode">
        <el-input v-model="queryParams.registrationCode" placeholder="请输入app注册码" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="二维码" prop="qrCodeImg">
        <el-input v-model="queryParams.qrCodeImg" placeholder="请输入二维码" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="责任护士" prop="chargeNurse">
        <el-input v-model="queryParams.chargeNurse" placeholder="请输入责任护士" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="责任医生" prop="chargeDoctor">
        <el-input v-model="queryParams.chargeDoctor" placeholder="请输入责任医生" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="住院次数" prop="hospitalTimes">
        <el-input v-model="queryParams.hospitalTimes" placeholder="请输入住院次数" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="住院科室" prop="hospitalDepart">
        <el-input v-model="queryParams.hospitalDepart" placeholder="请输入住院科室" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="住院床位号" prop="hospitalBed">
        <el-input v-model="queryParams.hospitalBed" placeholder="请输入住院床位号" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="责任医生所属科室" prop="chargeDoctorDepart">
        <el-input v-model="queryParams.chargeDoctorDepart" placeholder="请输入责任医生所属科室" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="科室编码" prop="hospitalDepartNumber">
        <el-input v-model="queryParams.hospitalDepartNumber" placeholder="请输入科室编码" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="病历类型日期" prop="caseTypeDate">
        <el-date-picker v-model="queryParams.caseTypeDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="病理类型结果" prop="caseTypeResult">
        <el-input v-model="queryParams.caseTypeResult" placeholder="请输入病理类型结果" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="是否注册" prop="isRegister">
        <el-input v-model="queryParams.isRegister" placeholder="请输入是否注册" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="下次置管日期" prop="nextVasDate">
        <el-date-picker v-model="queryParams.nextVasDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="下次透析充分性日期" prop="nextKtvDate">
        <el-date-picker v-model="queryParams.nextKtvDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="下次腹膜平衡试验日期" prop="nextPetDate">
        <el-date-picker v-model="queryParams.nextPetDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="录入时间" prop="inDate">
        <el-date-picker v-model="queryParams.inDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
      </el-form-item>
      <el-form-item label="失访原因" prop="lostFollowReason">
        <el-input v-model="queryParams.lostFollowReason" placeholder="请输入失访原因" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- 操作工具栏 -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
                   v-hasPermi="['main:patient:create']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
                   v-hasPermi="['main:patient:export']">导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <!-- 列表 -->
    <el-table v-loading="loading" :data="list">
      <el-table-column label="患者登记表" align="center" prop="patientId" />
      <el-table-column label="患者hisId" align="center" prop="patientHisId" />
      <el-table-column label="门诊号" align="center" prop="outpatientServiceNumber" />
      <el-table-column label="腹透号" align="center" prop="pdNumber" />
      <el-table-column label="姓名" align="center" prop="patientNm" />
      <el-table-column label="拼音码" align="center" prop="patientPy" />
      <el-table-column label="性别 0女 1男 " align="center" prop="patientSex">
        <template v-slot="scope">
          <dict-tag :type="DICT_TYPE.PATIENT_SEX" :value="scope.row.patientSex" />
        </template>
      </el-table-column>
      <el-table-column label="年龄" align="center" prop="patientAge" />
      <el-table-column label="民族" align="center" prop="patientNation">
        <template v-slot="scope">
          <dict-tag :type="DICT_TYPE.PATIENT_NATION" :value="scope.row.patientNation" />
        </template>
      </el-table-column>
      <el-table-column label="婚姻状况0001未婚 0002 已婚 0003 丧偶 0004 离婚 0005 其他" align="center" prop="maritalStatus" />
      <el-table-column label="身份证号" align="center" prop="patientCardId" />
      <el-table-column label="收费模式" align="center" prop="chargeMode" />
      <el-table-column label="患者类型" align="center" prop="chargeType" />
      <el-table-column label="出生日期" align="center" prop="patientBirthday" />
      <el-table-column label="身高" align="center" prop="patientHeight" />
      <el-table-column label="净体重" align="center" prop="dryWeight" />
      <el-table-column label="入院时间" align="center" prop="inHospitalDate" />
      <el-table-column label="出院时间" align="center" prop="dischargeDate" />
      <el-table-column label="死亡时间" align="center" prop="deathDate" />
      <el-table-column label="联系电话" align="center" prop="patientTel" />
      <el-table-column label="联系电话2" align="center" prop="patientTel2" />
      <el-table-column label="邮政编码" align="center" prop="postCode" />
      <el-table-column label="住院号" align="center" prop="hospitalizationNumber" />
      <el-table-column label="通讯地址" align="center" prop="patientAddress" />
      <el-table-column label="工作性质 onW退休  offW在职" align="center" prop="patientWorkType" />
      <el-table-column label="工作单位" align="center" prop="patientUnit" />
      <el-table-column label="紧急联系人" align="center" prop="emergencyContact" />
      <el-table-column label="联系人关系" align="center" prop="patientRelation" />
      <el-table-column label="医保卡号" align="center" prop="yiBaoCard" />
      <el-table-column label="删除标志位 0删除 1 未删除" align="center" prop="isActive" />
      <el-table-column label="创建人" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createDt" />
      <el-table-column label="更新人" align="center" prop="updateBy" />
      <el-table-column label="更新时间" align="center" prop="updateDt" />
      <el-table-column label="患者类型1  1感染 / 0未感染" align="center" prop="patientTypeOne" />
      <el-table-column label="患者类型2  1住院/2门诊" align="center" prop="patientTypeTwo" />
      <el-table-column label="诊断" align="center" prop="diagnose">
        <template v-slot="scope">
          <dict-tag :type="DICT_TYPE.DIAGNOSE_INFO" :value="scope.row.diagnose" />
        </template>
      </el-table-column>
      <el-table-column label="原发病类型" align="center" prop="protopathy" />
      <el-table-column label="病理诊断" align="center" prop="pathologicDiagnose" />
      <el-table-column label="合并症" align="center" prop="complication" />
      <el-table-column label="置管类型" align="center" prop="zhiguanType" />
      <el-table-column label="置管时间" align="center" prop="zhiguanDate" />
      <el-table-column label="既往病史" align="center" prop="pastMedicalHistory" />
      <el-table-column label="hd几年" align="center" prop="hdYears" />
      <el-table-column label="肾移植几年" align="center" prop="rtYears" />
      <el-table-column label="乙肝" align="center" prop="isHepatitisB" />
      <el-table-column label="丙肝" align="center" prop="isHepatitisC" />
      <el-table-column label="是否糖尿病" align="center" prop="isDm" />
      <el-table-column label="尿量" align="center" prop="urinaryVolume" />
      <el-table-column label="hiv" align="center" prop="isHiv" />
      <el-table-column label="梅毒" align="center" prop="isSyphilis" />
      <el-table-column label="病人状态（1入档，2死亡，3结案）" align="center" prop="patientStatus" />
      <el-table-column label="腹透开始时间" align="center" prop="firstTreatmentDate" />
      <el-table-column label="备注" align="center" prop="remarks" />
      <el-table-column label="离开腹透原因" align="center" prop="leavePdReason" />
      <el-table-column label="离开腹透日期" align="center" prop="leavePdDate" />
      <el-table-column label="腹膜炎重点病人" align="center" prop="isPeritonitisPatient" />
      <el-table-column label="外口感染患者" align="center" prop="isExternalInfectionPatient" />
      <el-table-column label="容量管控重点病人" align="center" prop="isCapcontrolPatient" />
      <el-table-column label="首次腹透时已透次数" align="center" prop="firstPdTimes" />
      <el-table-column label="腹透次数" align="center" prop="pdTimes" />
      <el-table-column label="复查周期" align="center" prop="revisitCycle" />
      <el-table-column label="首次复诊日期" align="center" prop="revisitDate" />
      <el-table-column label="复诊计划id" align="center" prop="revisitRecordsId" />
      <el-table-column label="随访周期" align="center" prop="followupCycle" />
      <el-table-column label="下次随访日期" align="center" prop="nextFollowupDate" />
      <el-table-column label="标记患者" align="center" prop="patientFlag" />
      <el-table-column label="死亡原因" align="center" prop="deathReason" />
      <el-table-column label="初次诊断（上报平台的临床诊断）" align="center" prop="linchuangZhenduan" />
      <el-table-column label="转为血透原因" align="center" prop="hemodialysisReason" />
      <el-table-column label="教育程度" align="center" prop="educationLevel" />
      <el-table-column label="职业" align="center" prop="occupation" />
      <el-table-column label="原发病诊断日期" align="center" prop="protopathyDate" />
      <el-table-column label="临床诊断日期" align="center" prop="clinicalDiagnosisDate" />
      <el-table-column label="是否导出过退出记录：0为未导出，1为已导出" align="center" prop="isInOutExportStatus" />
      <el-table-column label="门诊为1，住院为2" align="center" prop="patientProperty" />
      <el-table-column label="app注册码" align="center" prop="registrationCode" />
      <el-table-column label="二维码" align="center" prop="qrCodeImg" />
      <el-table-column label="责任护士" align="center" prop="chargeNurse" />
      <el-table-column label="责任医生" align="center" prop="chargeDoctor" />
      <el-table-column label="住院次数" align="center" prop="hospitalTimes" />
      <el-table-column label="住院科室" align="center" prop="hospitalDepart" />
      <el-table-column label="住院床位号" align="center" prop="hospitalBed" />
      <el-table-column label="责任医生所属科室" align="center" prop="chargeDoctorDepart" />
      <el-table-column label="科室编码" align="center" prop="hospitalDepartNumber" />
      <el-table-column label="病历类型日期" align="center" prop="caseTypeDate" />
      <el-table-column label="病理类型结果" align="center" prop="caseTypeResult" />
      <el-table-column label="是否注册" align="center" prop="isRegister" />
      <el-table-column label="下次置管日期" align="center" prop="nextVasDate" />
      <el-table-column label="下次透析充分性日期" align="center" prop="nextKtvDate" />
      <el-table-column label="下次腹膜平衡试验日期" align="center" prop="nextPetDate" />
      <el-table-column label="录入时间" align="center" prop="inDate" />
      <el-table-column label="失访原因" align="center" prop="lostFollowReason" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template v-slot="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
                     v-hasPermi="['main:patient:update']">修改</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
                     v-hasPermi="['main:patient:delete']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
                @pagination="getList"/>

    <!-- 对话框(添加 / 修改) -->
    <el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="患者hisId" prop="patientHisId">
          <el-input v-model="form.patientHisId" placeholder="请输入患者hisId" />
        </el-form-item>
        <el-form-item label="门诊号" prop="outpatientServiceNumber">
          <el-input v-model="form.outpatientServiceNumber" placeholder="请输入门诊号" />
        </el-form-item>
        <el-form-item label="腹透号" prop="pdNumber">
          <el-input v-model="form.pdNumber" placeholder="请输入腹透号" />
        </el-form-item>
        <el-form-item label="姓名" prop="patientNm">
          <el-input v-model="form.patientNm" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="拼音码" prop="patientPy">
          <el-input v-model="form.patientPy" placeholder="请输入拼音码" />
        </el-form-item>
        <el-form-item label="性别 0女 1男 " prop="patientSex">
          <el-select v-model="form.patientSex" placeholder="请选择性别 0女 1男 ">
            <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PATIENT_SEX)"
                       :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="年龄" prop="patientAge">
          <el-input v-model="form.patientAge" placeholder="请输入年龄" />
        </el-form-item>
        <el-form-item label="民族" prop="patientNation">
          <el-select v-model="form.patientNation" placeholder="请选择民族">
            <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PATIENT_NATION)"
                       :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="婚姻状况0001未婚 0002 已婚 0003 丧偶 0004 离婚 0005 其他" prop="maritalStatus">
          <el-select v-model="form.maritalStatus" placeholder="请选择婚姻状况0001未婚 0002 已婚 0003 丧偶 0004 离婚 0005 其他">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="身份证号" prop="patientCardId">
          <el-input v-model="form.patientCardId" placeholder="请输入身份证号" />
        </el-form-item>
        <el-form-item label="收费模式" prop="chargeMode">
          <el-input v-model="form.chargeMode" placeholder="请输入收费模式" />
        </el-form-item>
        <el-form-item label="患者类型" prop="chargeType">
          <el-select v-model="form.chargeType" placeholder="请选择患者类型">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="出生日期" prop="patientBirthday">
          <el-date-picker clearable v-model="form.patientBirthday" type="date" value-format="timestamp" placeholder="选择出生日期" />
        </el-form-item>
        <el-form-item label="身高" prop="patientHeight">
          <el-input v-model="form.patientHeight" placeholder="请输入身高" />
        </el-form-item>
        <el-form-item label="净体重" prop="dryWeight">
          <el-input v-model="form.dryWeight" placeholder="请输入净体重" />
        </el-form-item>
        <el-form-item label="入院时间" prop="inHospitalDate">
          <el-date-picker clearable v-model="form.inHospitalDate" type="date" value-format="timestamp" placeholder="选择入院时间" />
        </el-form-item>
        <el-form-item label="出院时间" prop="dischargeDate">
          <el-date-picker clearable v-model="form.dischargeDate" type="date" value-format="timestamp" placeholder="选择出院时间" />
        </el-form-item>
        <el-form-item label="死亡时间" prop="deathDate">
          <el-date-picker clearable v-model="form.deathDate" type="date" value-format="timestamp" placeholder="选择死亡时间" />
        </el-form-item>
        <el-form-item label="联系电话" prop="patientTel">
          <el-input v-model="form.patientTel" placeholder="请输入联系电话" />
        </el-form-item>
        <el-form-item label="联系电话2" prop="patientTel2">
          <el-input v-model="form.patientTel2" placeholder="请输入联系电话2" />
        </el-form-item>
        <el-form-item label="邮政编码" prop="postCode">
          <el-input v-model="form.postCode" placeholder="请输入邮政编码" />
        </el-form-item>
        <el-form-item label="住院号" prop="hospitalizationNumber">
          <el-input v-model="form.hospitalizationNumber" placeholder="请输入住院号" />
        </el-form-item>
        <el-form-item label="通讯地址" prop="patientAddress">
          <el-input v-model="form.patientAddress" placeholder="请输入通讯地址" />
        </el-form-item>
        <el-form-item label="工作性质 onW退休  offW在职" prop="patientWorkType">
          <el-select v-model="form.patientWorkType" placeholder="请选择工作性质 onW退休  offW在职">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="工作单位" prop="patientUnit">
          <el-input v-model="form.patientUnit" placeholder="请输入工作单位" />
        </el-form-item>
        <el-form-item label="紧急联系人" prop="emergencyContact">
          <el-input v-model="form.emergencyContact" placeholder="请输入紧急联系人" />
        </el-form-item>
        <el-form-item label="联系人关系" prop="patientRelation">
          <el-input v-model="form.patientRelation" placeholder="请输入联系人关系" />
        </el-form-item>
        <el-form-item label="医保卡号" prop="yiBaoCard">
          <el-input v-model="form.yiBaoCard" placeholder="请输入医保卡号" />
        </el-form-item>
        <el-form-item label="删除标志位 0删除 1 未删除" prop="isActive">
          <el-input v-model="form.isActive" placeholder="请输入删除标志位 0删除 1 未删除" />
        </el-form-item>
        <el-form-item label="创建人" prop="createBy">
          <el-input v-model="form.createBy" placeholder="请输入创建人" />
        </el-form-item>
        <el-form-item label="创建时间" prop="createDt">
          <el-date-picker clearable v-model="form.createDt" type="date" value-format="timestamp" placeholder="选择创建时间" />
        </el-form-item>
        <el-form-item label="更新人" prop="updateBy">
          <el-input v-model="form.updateBy" placeholder="请输入更新人" />
        </el-form-item>
        <el-form-item label="更新时间" prop="updateDt">
          <el-input v-model="form.updateDt" placeholder="请输入更新时间" />
        </el-form-item>
        <el-form-item label="患者类型1  1感染 / 0未感染" prop="patientTypeOne">
          <el-input v-model="form.patientTypeOne" placeholder="请输入患者类型1  1感染 / 0未感染" />
        </el-form-item>
        <el-form-item label="患者类型2  1住院/2门诊" prop="patientTypeTwo">
          <el-input v-model="form.patientTypeTwo" placeholder="请输入患者类型2  1住院/2门诊" />
        </el-form-item>
        <el-form-item label="诊断" prop="diagnose">
          <el-select v-model="form.diagnose" placeholder="请选择诊断">
            <el-option v-for="dict in this.getDictDatas(DICT_TYPE.DIAGNOSE_INFO)"
                       :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="原发病类型" prop="protopathy">
          <el-select v-model="form.protopathy" placeholder="请选择原发病类型">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="病理诊断" prop="pathologicDiagnose">
          <el-input v-model="form.pathologicDiagnose" placeholder="请输入病理诊断" />
        </el-form-item>
        <el-form-item label="合并症" prop="complication">
          <el-input v-model="form.complication" placeholder="请输入合并症" />
        </el-form-item>
        <el-form-item label="置管类型" prop="zhiguanType">
          <el-select v-model="form.zhiguanType" placeholder="请选择置管类型">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="置管时间" prop="zhiguanDate">
          <el-date-picker clearable v-model="form.zhiguanDate" type="date" value-format="timestamp" placeholder="选择置管时间" />
        </el-form-item>
        <el-form-item label="既往病史" prop="pastMedicalHistory">
          <el-input v-model="form.pastMedicalHistory" placeholder="请输入既往病史" />
        </el-form-item>
        <el-form-item label="hd几年" prop="hdYears">
          <el-input v-model="form.hdYears" placeholder="请输入hd几年" />
        </el-form-item>
        <el-form-item label="肾移植几年" prop="rtYears">
          <el-input v-model="form.rtYears" placeholder="请输入肾移植几年" />
        </el-form-item>
        <el-form-item label="乙肝" prop="isHepatitisB">
          <el-input v-model="form.isHepatitisB" placeholder="请输入乙肝" />
        </el-form-item>
        <el-form-item label="丙肝" prop="isHepatitisC">
          <el-input v-model="form.isHepatitisC" placeholder="请输入丙肝" />
        </el-form-item>
        <el-form-item label="是否糖尿病" prop="isDm">
          <el-input v-model="form.isDm" placeholder="请输入是否糖尿病" />
        </el-form-item>
        <el-form-item label="尿量" prop="urinaryVolume">
          <el-input v-model="form.urinaryVolume" placeholder="请输入尿量" />
        </el-form-item>
        <el-form-item label="hiv" prop="isHiv">
          <el-input v-model="form.isHiv" placeholder="请输入hiv" />
        </el-form-item>
        <el-form-item label="梅毒" prop="isSyphilis">
          <el-input v-model="form.isSyphilis" placeholder="请输入梅毒" />
        </el-form-item>
        <el-form-item label="病人状态（1入档，2死亡，3结案）" prop="patientStatus">
          <el-radio-group v-model="form.patientStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="腹透开始时间" prop="firstTreatmentDate">
          <el-date-picker clearable v-model="form.firstTreatmentDate" type="date" value-format="timestamp" placeholder="选择腹透开始时间" />
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="离开腹透原因" prop="leavePdReason">
          <el-input v-model="form.leavePdReason" placeholder="请输入离开腹透原因" />
        </el-form-item>
        <el-form-item label="离开腹透日期" prop="leavePdDate">
          <el-date-picker clearable v-model="form.leavePdDate" type="date" value-format="timestamp" placeholder="选择离开腹透日期" />
        </el-form-item>
        <el-form-item label="腹膜炎重点病人" prop="isPeritonitisPatient">
          <el-input v-model="form.isPeritonitisPatient" placeholder="请输入腹膜炎重点病人" />
        </el-form-item>
        <el-form-item label="外口感染患者" prop="isExternalInfectionPatient">
          <el-input v-model="form.isExternalInfectionPatient" placeholder="请输入外口感染患者" />
        </el-form-item>
        <el-form-item label="容量管控重点病人" prop="isCapcontrolPatient">
          <el-input v-model="form.isCapcontrolPatient" placeholder="请输入容量管控重点病人" />
        </el-form-item>
        <el-form-item label="首次腹透时已透次数" prop="firstPdTimes">
          <el-input v-model="form.firstPdTimes" placeholder="请输入首次腹透时已透次数" />
        </el-form-item>
        <el-form-item label="腹透次数" prop="pdTimes">
          <el-input v-model="form.pdTimes" placeholder="请输入腹透次数" />
        </el-form-item>
        <el-form-item label="复查周期" prop="revisitCycle">
          <el-input v-model="form.revisitCycle" placeholder="请输入复查周期" />
        </el-form-item>
        <el-form-item label="首次复诊日期" prop="revisitDate">
          <el-date-picker clearable v-model="form.revisitDate" type="date" value-format="timestamp" placeholder="选择首次复诊日期" />
        </el-form-item>
        <el-form-item label="复诊计划id" prop="revisitRecordsId">
          <el-input v-model="form.revisitRecordsId" placeholder="请输入复诊计划id" />
        </el-form-item>
        <el-form-item label="随访周期" prop="followupCycle">
          <el-input v-model="form.followupCycle" placeholder="请输入随访周期" />
        </el-form-item>
        <el-form-item label="下次随访日期" prop="nextFollowupDate">
          <el-date-picker clearable v-model="form.nextFollowupDate" type="date" value-format="timestamp" placeholder="选择下次随访日期" />
        </el-form-item>
        <el-form-item label="标记患者" prop="patientFlag">
          <el-input v-model="form.patientFlag" placeholder="请输入标记患者" />
        </el-form-item>
        <el-form-item label="死亡原因" prop="deathReason">
          <el-input v-model="form.deathReason" placeholder="请输入死亡原因" />
        </el-form-item>
        <el-form-item label="初次诊断（上报平台的临床诊断）" prop="linchuangZhenduan">
          <el-input v-model="form.linchuangZhenduan" placeholder="请输入初次诊断（上报平台的临床诊断）" />
        </el-form-item>
        <el-form-item label="转为血透原因" prop="hemodialysisReason">
          <el-input v-model="form.hemodialysisReason" placeholder="请输入转为血透原因" />
        </el-form-item>
        <el-form-item label="教育程度" prop="educationLevel">
          <el-input v-model="form.educationLevel" placeholder="请输入教育程度" />
        </el-form-item>
        <el-form-item label="职业" prop="occupation">
          <el-input v-model="form.occupation" placeholder="请输入职业" />
        </el-form-item>
        <el-form-item label="原发病诊断日期" prop="protopathyDate">
          <el-date-picker clearable v-model="form.protopathyDate" type="date" value-format="timestamp" placeholder="选择原发病诊断日期" />
        </el-form-item>
        <el-form-item label="临床诊断日期" prop="clinicalDiagnosisDate">
          <el-date-picker clearable v-model="form.clinicalDiagnosisDate" type="date" value-format="timestamp" placeholder="选择临床诊断日期" />
        </el-form-item>
        <el-form-item label="是否导出过退出记录：0为未导出，1为已导出" prop="isInOutExportStatus">
          <el-radio-group v-model="form.isInOutExportStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="门诊为1，住院为2" prop="patientProperty">
          <el-input v-model="form.patientProperty" placeholder="请输入门诊为1，住院为2" />
        </el-form-item>
        <el-form-item label="app注册码" prop="registrationCode">
          <el-input v-model="form.registrationCode" placeholder="请输入app注册码" />
        </el-form-item>
        <el-form-item label="二维码" prop="qrCodeImg">
          <el-input v-model="form.qrCodeImg" placeholder="请输入二维码" />
        </el-form-item>
        <el-form-item label="责任护士" prop="chargeNurse">
          <el-input v-model="form.chargeNurse" placeholder="请输入责任护士" />
        </el-form-item>
        <el-form-item label="责任医生" prop="chargeDoctor">
          <el-input v-model="form.chargeDoctor" placeholder="请输入责任医生" />
        </el-form-item>
        <el-form-item label="住院次数" prop="hospitalTimes">
          <el-input v-model="form.hospitalTimes" placeholder="请输入住院次数" />
        </el-form-item>
        <el-form-item label="住院科室" prop="hospitalDepart">
          <el-input v-model="form.hospitalDepart" placeholder="请输入住院科室" />
        </el-form-item>
        <el-form-item label="住院床位号" prop="hospitalBed">
          <el-input v-model="form.hospitalBed" placeholder="请输入住院床位号" />
        </el-form-item>
        <el-form-item label="责任医生所属科室" prop="chargeDoctorDepart">
          <el-input v-model="form.chargeDoctorDepart" placeholder="请输入责任医生所属科室" />
        </el-form-item>
        <el-form-item label="科室编码" prop="hospitalDepartNumber">
          <el-input v-model="form.hospitalDepartNumber" placeholder="请输入科室编码" />
        </el-form-item>
        <el-form-item label="病历类型日期" prop="caseTypeDate">
          <el-date-picker clearable v-model="form.caseTypeDate" type="date" value-format="timestamp" placeholder="选择病历类型日期" />
        </el-form-item>
        <el-form-item label="病理类型结果" prop="caseTypeResult">
          <el-input v-model="form.caseTypeResult" placeholder="请输入病理类型结果" />
        </el-form-item>
        <el-form-item label="是否注册" prop="isRegister">
          <el-input v-model="form.isRegister" placeholder="请输入是否注册" />
        </el-form-item>
        <el-form-item label="下次置管日期" prop="nextVasDate">
          <el-date-picker clearable v-model="form.nextVasDate" type="date" value-format="timestamp" placeholder="选择下次置管日期" />
        </el-form-item>
        <el-form-item label="下次透析充分性日期" prop="nextKtvDate">
          <el-date-picker clearable v-model="form.nextKtvDate" type="date" value-format="timestamp" placeholder="选择下次透析充分性日期" />
        </el-form-item>
        <el-form-item label="下次腹膜平衡试验日期" prop="nextPetDate">
          <el-date-picker clearable v-model="form.nextPetDate" type="date" value-format="timestamp" placeholder="选择下次腹膜平衡试验日期" />
        </el-form-item>
        <el-form-item label="录入时间" prop="inDate">
          <el-date-picker clearable v-model="form.inDate" type="date" value-format="timestamp" placeholder="选择录入时间" />
        </el-form-item>
        <el-form-item label="失访原因" prop="lostFollowReason">
          <el-input v-model="form.lostFollowReason" placeholder="请输入失访原因" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  createPatient,
  deletePatient,
  exportPatientExcel,
  getPatient,
  getPatientPage,
  updatePatient
} from "@/api/main/patient";

export default {
  name: "Patient",
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 患者信息列表
      list: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNo: 1,
        pageSize: 10,
        patientId: null,
        patientHisId: null,
        outpatientServiceNumber: null,
        pdNumber: null,
        patientNm: null,
        patientPy: null,
        patientSex: null,
        patientAge: null,
        patientNation: null,
        maritalStatus: null,
        patientCardId: null,
        chargeMode: null,
        chargeType: null,
        patientBirthday: null,
        patientBirthday: [],
        patientHeight: null,
        dryWeight: null,
        inHospitalDate: [],
        dischargeDate: [],
        deathDate: [],
        patientTel: null,
        patientTel2: null,
        postCode: null,
        hospitalizationNumber: null,
        patientAddress: null,
        patientWorkType: null,
        patientUnit: null,
        emergencyContact: null,
        patientRelation: null,
        yiBaoCard: null,
        isActive: null,
        createBy: null,
        createDt: null,
        createDt: [],
        updateBy: null,
        updateDt: null,
        patientTypeOne: null,
        patientTypeTwo: null,
        diagnose: null,
        protopathy: null,
        pathologicDiagnose: null,
        complication: null,
        zhiguanType: null,
        zhiguanDate: [],
        pastMedicalHistory: null,
        hdYears: null,
        rtYears: null,
        isHepatitisB: null,
        isHepatitisC: null,
        isDm: null,
        urinaryVolume: null,
        isHiv: null,
        isSyphilis: null,
        patientStatus: null,
        firstTreatmentDate: null,
        firstTreatmentDate: [],
        remarks: null,
        leavePdReason: null,
        leavePdDate: [],
        isPeritonitisPatient: null,
        isExternalInfectionPatient: null,
        isCapcontrolPatient: null,
        firstPdTimes: null,
        pdTimes: null,
        revisitCycle: null,
        revisitDate: [],
        revisitRecordsId: null,
        followupCycle: null,
        nextFollowupDate: [],
        patientFlag: null,
        deathReason: null,
        linchuangZhenduan: null,
        hemodialysisReason: null,
        educationLevel: null,
        occupation: null,
        protopathyDate: [],
        clinicalDiagnosisDate: [],
        isInOutExportStatus: null,
        patientProperty: null,
        registrationCode: null,
        qrCodeImg: null,
        chargeNurse: null,
        chargeDoctor: null,
        hospitalTimes: null,
        hospitalDepart: null,
        hospitalBed: null,
        chargeDoctorDepart: null,
        hospitalDepartNumber: null,
        caseTypeDate: [],
        caseTypeResult: null,
        isRegister: null,
        nextVasDate: [],
        nextKtvDate: [],
        nextPetDate: [],
        inDate: [],
        lostFollowReason: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      // 执行查询
      getPatientPage(this.queryParams).then(response => {
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
      });
    },
    /** 取消按钮 */
    cancel() {
      this.open = false;
      this.reset();
    },
    /** 表单重置 */
    reset() {
      this.form = {
        patientId: undefined,
        patientHisId: undefined,
        outpatientServiceNumber: undefined,
        pdNumber: undefined,
        patientNm: undefined,
        patientPy: undefined,
        patientSex: undefined,
        patientAge: undefined,
        patientNation: undefined,
        maritalStatus: undefined,
        patientCardId: undefined,
        chargeMode: undefined,
        chargeType: undefined,
        patientBirthday: undefined,
        patientHeight: undefined,
        dryWeight: undefined,
        inHospitalDate: undefined,
        dischargeDate: undefined,
        deathDate: undefined,
        patientTel: undefined,
        patientTel2: undefined,
        postCode: undefined,
        hospitalizationNumber: undefined,
        patientAddress: undefined,
        patientWorkType: undefined,
        patientUnit: undefined,
        emergencyContact: undefined,
        patientRelation: undefined,
        yiBaoCard: undefined,
        isActive: undefined,
        createBy: undefined,
        createDt: undefined,
        updateBy: undefined,
        updateDt: undefined,
        patientTypeOne: undefined,
        patientTypeTwo: undefined,
        diagnose: undefined,
        protopathy: undefined,
        pathologicDiagnose: undefined,
        complication: undefined,
        zhiguanType: undefined,
        zhiguanDate: undefined,
        pastMedicalHistory: undefined,
        hdYears: undefined,
        rtYears: undefined,
        isHepatitisB: undefined,
        isHepatitisC: undefined,
        isDm: undefined,
        urinaryVolume: undefined,
        isHiv: undefined,
        isSyphilis: undefined,
        patientStatus: undefined,
        firstTreatmentDate: undefined,
        remarks: undefined,
        leavePdReason: undefined,
        leavePdDate: undefined,
        isPeritonitisPatient: undefined,
        isExternalInfectionPatient: undefined,
        isCapcontrolPatient: undefined,
        firstPdTimes: undefined,
        pdTimes: undefined,
        revisitCycle: undefined,
        revisitDate: undefined,
        revisitRecordsId: undefined,
        followupCycle: undefined,
        nextFollowupDate: undefined,
        patientFlag: undefined,
        deathReason: undefined,
        linchuangZhenduan: undefined,
        hemodialysisReason: undefined,
        educationLevel: undefined,
        occupation: undefined,
        protopathyDate: undefined,
        clinicalDiagnosisDate: undefined,
        isInOutExportStatus: undefined,
        patientProperty: undefined,
        registrationCode: undefined,
        qrCodeImg: undefined,
        chargeNurse: undefined,
        chargeDoctor: undefined,
        hospitalTimes: undefined,
        hospitalDepart: undefined,
        hospitalBed: undefined,
        chargeDoctorDepart: undefined,
        hospitalDepartNumber: undefined,
        caseTypeDate: undefined,
        caseTypeResult: undefined,
        isRegister: undefined,
        nextVasDate: undefined,
        nextKtvDate: undefined,
        nextPetDate: undefined,
        inDate: undefined,
        lostFollowReason: undefined,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNo = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加患者信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const patientId = row.patientId;
      getPatient(patientId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改患者信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (!valid) {
          return;
        }
        // 修改的提交
        if (this.form.patientId != null) {
          updatePatient(this.form).then(response => {
            this.$modal.msgSuccess("修改成功");
            this.open = false;
            this.getList();
          });
          return;
        }
        // 添加的提交
        createPatient(this.form).then(response => {
          this.$modal.msgSuccess("新增成功");
          this.open = false;
          this.getList();
        });
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const patientId = row.patientId;
      this.$modal.confirm('是否确认删除患者信息编号为"' + patientId + '"的数据项?').then(function() {
          return deletePatient(patientId);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      // 处理查询参数
      let params = {...this.queryParams};
      params.pageNo = undefined;
      params.pageSize = undefined;
      this.$modal.confirm('是否确认导出所有患者信息数据项?').then(() => {
          this.exportLoading = true;
          return exportPatientExcel(params);
        }).then(response => {
          this.$download.excel(response, '患者信息.xls');
          this.exportLoading = false;
        }).catch(() => {});
    }
  }
};
</script>
